package com.sgb.kjwl.view.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.swgk.core.util.PickSelectEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/**
 * @author younghow
 * @date 2021/6/22
 */
public class PackerSignUpAdapter extends YoungBaseRecycleAdapter<PickSelectEntity> {

    public PackerSignUpAdapter(Context context, List<PickSelectEntity> datas) {
        super(context, R.layout.item_pick_filter_sign_up_child, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final PickSelectEntity entity) {
        holder.setBinding(BR.viewModel, entity);

        ImageView imageView = holder.getItem().findViewById(R.id.iv_bottom);
        if (holder.getIndex_position() == datas.size()-1){
            imageView.setVisibility(View.VISIBLE);
        }else {
            imageView.setVisibility(View.GONE);
        }
        setMaxCheckNum(20);
    }

}
